﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

using OpenTK;
using System.ComponentModel;
using System.Collections;

namespace NLE
{

    public class LevelObject
    {
        [BrowsableAttribute(false)]
        public Vector2 Origin { get; set; }

        [BrowsableAttribute(false)]
        public Layer Layer { get; set; }

        [BrowsableAttribute(false)]
        public bool IsHidden { get; set; }

        // Todo: add property to dynamically change layer

        [Category("Origin")]
        [DisplayName("X")]
        public float oX
        {
            get { return Origin.X; }
            set { Origin = new Vector2(value, Origin.Y); }
        }

        [Category("Origin")]
        [DisplayName("Y")]
        public float oY
        {
            get { return Origin.Y; }
            set { Origin = new Vector2(Origin.X, value); }
        }

        [BrowsableAttribute(false)]
        public Vector2 Position { get; set; }

        [Category("Position")]
        [DisplayName("X")]
        public float pX
        {
            get { return Position.X; }
            set { Position = new Vector2(value, Position.Y); }
        }

        [Category("Position")]
        [DisplayName("Y")]
        public float pY
        {
            get { return Position.Y; }
            set { Position = new Vector2(Position.X, value); }
        }

        public Vector2 Scale { get; set; }

        [DisplayName("Rotation (Degrees)")]
        public float Rotation { get; set; }

        [DisplayName("Draw Order")]
        public float zOrder { get; set; }

        [BrowsableAttribute(false)]
        public String TextureName { get; set; }

        // Ball_01, Ball_02, etc...
        [ReadOnly(true)]
        public String Name { get; set; }

        [DisplayName("Class name")]
        public String Class { get; set; }

        // Custom properties
        [BrowsableAttribute(false)]
        Dictionary<string, string> _properties = new Dictionary<string, string>();

        [BrowsableAttribute(false)]
        public Dictionary<string, string> Properties
        {
            get { return _properties; }
            set { _properties = value; }
        }

        public Vector2 LastUsedPositionBeforeAction { get; set; }
        public float LastUsedRotationBeforeAction { get; set; }
        public Vector2 LastUsedScaleBeforeAction { get; set; }
        public float LastUsedzOrderBeforeAction { get; set; }
                                                           
    }
}
